﻿@model IEnumerable<StockShark.Models.BrokerageAccount>

@{
    ViewBag.Title = "Moje rachunki";
    ViewBag.Header = "Moje rachunki maklerskie";
}

<table>
    <tr>
        <th>
            Nazwa rachunku
        </th>
        <th>
            Wolne środki
        </th>
        <th>
            Wartość portfela
        </th>
        <th>
            Data założenia
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink(item.Name, "Details", new { name = item.Name })
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Balance) PLN
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.TotalValue) PLN
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.CreationDate)
        </td>
        <td>
            @Html.ActionLink("Edytuj", "Edit", new { name = item.Name }) |
            @Html.ActionLink("Zamknij", "Delete", new { name = item.Name })
        </td>
    </tr>
}
@if (Model.Count() < 5)
{
<tr>
    <td colspan="5">@Html.ActionLink("Otwórz nowy rachunek", "Create")</td>
</tr>
}
</table>

<p>
    
</p>